#include "Camera.hpp"
#include "../core/glm.hpp"
#include "../renderer/Renderer.hpp"

Camera::Camera(glm::vec3 position) : GameObject("camera", position) {
    glm::vec3 eye = position;
    glm::vec3 at(0.0f, 1.0f, 0.0f);
    glm::vec3 up(0.0f, 1.0f, 0.0f);
    transform = glm::inverse(glm::lookAt(eye, at, up));
    projection = glm::perspective(60.0f, 4.0f / 3.0f, 0.1f, 500.0f);
}

Camera::~Camera() {
    //dtor
}

void Camera::accept(Visitor* visitor) {
    visitor->visit(this);
}

glm::mat4 Camera::getProjection() {
    return projection;
}
